<template>
  <div class="child">
    <h1>我是Child组件</h1>
    男<input type="radio" name="sex" :checked="xingbie ==='male'"  @change="handleClick('male')">
    女<input type="radio" name="sex" :checked="xingbie ==='female'"  @change="handleClick('female')">
  </div>
</template>

<script>
  export default {
    name:'Child',
    props:['xingbie','updateXingbie'],
    methods: {
      handleClick(value){
        this.updateXingbie(value)
      }
    },
  }
</script>

<style scoped>
  .child {
    background-color: orange;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px black;
    font-size: 30px;
  }
  input {
    width: 30px;
    height: 30px;
  }
</style>